package com.example.demo.singleton;

import org.springframework.stereotype.Component;

// 单例模式，Spring 中默认的 Bean 作用域是单例
@Component
public class Singleton {
    public void doSomething() {
        System.out.println("Singleton is doing something.");
    }
}    